﻿/*------------------------------------------------
// File Description: ColorSet DataBase Entity
// Author:			 Crane
// Create Time:		 2020-07-03 22:33:04
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 颜色配置
    /// </summary>
    [Table(nameof(ColorSet))]
    public class ColorSet : BaseEntity
    {
        private string _colorCode = string.Empty;
        private string _color = string.Empty;

        #region Public Property

        ///<Summary>
        /// 组件颜色
        ///</Summary>
        public Enum.ColorType ColorType { get; set; }

        ///<Summary>
        /// 组件颜色代码
        ///</Summary>
        public string ColorCode
        {
            get { return string.IsNullOrWhiteSpace(_colorCode) ? string.Empty : _colorCode; }
            set { _colorCode = value; }
        }

        ///<Summary>
        /// Color
        ///</Summary>
        public string Color
        {
            get { return string.IsNullOrWhiteSpace(_color) ? string.Empty : _color; }
            set { _color = value; }
        }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 颜色配置
        /// </summary>
        public virtual DbSet<ColorSet> ColorSets { get; set; }
    }
}